package Experiment2;

public class Teacher {
    private String teacherId;
    private String name;
    private String gender;
    private Course course;

    public Teacher(String teacherId, String name, String gender) {
        this.teacherId = teacherId;
        this.name = name;
        this.gender = gender;
    }

    public void openCourse(Course course) {
        this.course = course;
        System.out.println("教师 " + name + " 开设课程：" + course.getCourseName());
    }

    // Getter方法
    public String getTeacherId() { return teacherId; }
    public String getName() { return name; }
    public Course getCourse() { return course; }
}
